package IC.AST.nodes;

import IC.AST.*;

/**
 * an array element
 */
public class ArrayElmVar extends Variable {
	private Expression array;	// the array specifier
	private Expression index;	// the index specifier

	/**
	 * @param array the array specifier
	 * @param index the index specifier
	 * @param fileName TODO
	 * @param line the node line number
	 * @param column the node column number
	 */
	public ArrayElmVar(Expression array, Expression index, String fileName, int line, int column) {
		super(fileName,line, column);
		this.array = array;
		this.index = index;
	}

	/**
	 * @return the array specifier
	 */
	public Expression getArray() {
		return this.array;
	}

	/**
	 * @return the index specifier
	 */
	public Expression getIndex() {
		return this.index;
	}

	public <D,U> U accept(PropogatingVisitor<D,U> v, D context) throws Exception {
		return v.visit(this,context);
	}
}
